#include <func.h>
#include "head.h"

int main(int argc,char* argv[]){
    ARGS_CHECK(argc,3);
    int sockfd = socket(AF_INET,SOCK_STREAM,0);
    struct sockaddr_in addr;
    memset(&addr,0,sizeof(addr));
    addr.sin_family = AF_INET;
    addr.sin_addr.s_addr = inet_addr(argv[1]);//ip地址
    addr.sin_port = htons(atoi(argv[2]));//端口号
    int ret = connect(sockfd,(struct sockaddr *)&addr,sizeof(addr));
    ERROR_CHECK(ret,-1,"connect");
    printf("connect successed\n");
    recvFile(sockfd);
    close(sockfd);
    return 0;
}

